package hao.homework;

import java.util.Scanner;
public class User {
    public static void main(String[] args){
        System.out.printf("欢迎使用租车系统\n您是否要租车？1是 2否\n");//用户进入界面
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        if (i == 1) {
            car ad = new audi();//导入奥迪A4+
            car mzd = new mazida();//马自达6
            car jl = new jinlong();//金龙
            pika pkx = new pikaxue();//皮卡雪6
            trunk shj = new songhuajiang();//松花江+
            trunk ywk = new yiweike();//依维柯+

            System.out.println("您可租车的类型及其价目表：");
            System.out.println("序号 汽车名称 租金       容量");//价目表头
            System.out.println("1.   " + ad.carName() + "   " + ad.money() + "元/天   " + ad.people() + "人");//1.   奥迪A4  500元/天   4人
            System.out.println("2.   " + mzd.carName() + "  " + mzd.money() + "元/天 " + mzd.people() + "人");
            System.out.println("3.   " + jl.carName() + "   " + jl.money() + "元/天   " + jl.people() + "人");
            System.out.println("4.   " + pkx.pikaName() + "  " + pkx.money() + "元/天   " + pkx.people() + "人" + " " + pkx.content() + "吨");
            System.out.println("5.   " + shj.trunkName() + "  " + shj.money() + "元/天   " + shj.content() + "吨");
            System.out.println("6.   " + ywk.trunkName() + "   " + ywk.money() + "元/天  " + ywk.content() + "吨");

            //输入租车天数
            System.out.println("请输入您要租车的天数");
            int Day = sc.nextInt();

                int moneyCount=0;//金额
                System.out.println("请输入您选择车的序号\n");
                int id=sc.nextInt();
                if(id==1){
                    moneyCount+=ad.money()*Day;
                }else if (id==2){
                    moneyCount+=mzd.money()*Day;
                }else if (id==3){
                    moneyCount+=pkx.money()*Day;
                }else if (id==4){
                    moneyCount+=jl.money()*Day;
                }else if (id==5){
                    moneyCount+=shj.money()*Day;
                }else if (id==6){
                    moneyCount+=ywk.money()*Day;
                } else{
                    System.out.println("您的输入有误，请重新输入！");
                }
            System.out.println("**************您的账单如下：**************");
            System.out.println();
            System.out.println("******"+id+"******"+Day+"******");
            System.out.println("****总计费用为"+moneyCount+"元****");
        }
        else
            System.out.println("欢迎您的下次使用，谢谢！");
    }}

